package com.mvc.finance.model;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.mvc.ProjectUtils;
import com.mvc.base.model.BaseCompany;
import com.mvc.base.model.Supplier;

@Entity(name = "B_BANK_STATEMENT")
public class BankStatement extends BaseCompany {
	public static final int	          STATUS_SUBMIT	   = 1;
	public static final int	          STATUS_COMFIRMED	= ExpenseApply.STATUS_COMMIT;
	public static final int	          STATUS_APPROVAED	= ExpenseApply.STATUS_APPROVAED;
	@NotNull
	private Integer	                  makerUserId;
	@NotNull
	private Integer	                  supplierId;
	@NotNull
	@Length(max = 64)
	private String	                  payment;
	@NotNull
	private Date	                  sendDate;
	// 预计付款日期
	@NotNull
	private Date	                  predictPayDate;

	private Date	                  payDate;
	@NotNull
	private Integer	                  currency;
	// 定金
	private Double	                  earnest;
	private Double	                  total;
	@Length(max = 128)
	private String	                  remark;
	private Date	                  confirmDate;
	@NotNull
	private Date	                  generateDate;
	private Integer	                  confirmuUserId;
	@NotNull
	private Integer	                  status;

	private Integer	                  approvalUserId;

	private Date	                  approvalDate;

	@NotNull
	private Integer	                  financeStatus;

	@Transient
	private Supplier	              supplier;
	@Transient
	private List<BankStatementItem>	  bankStatementItems;

	@Transient
	private List<BankStatementCharge>	bankStatementCharges;

	public String getPayment() {
		return payment;
	}

	public void setPayment(String payment) {
		this.payment = payment;
	}

	public Date getPayDate() {
		return payDate;
	}

	public void setPayDate(Date payDate) {
		this.payDate = payDate;
	}

	public Integer getCurrency() {
		return currency;
	}

	public void setCurrency(Integer currency) {
		this.currency = currency;
	}

	public Double getEarnest() {
		return earnest;
	}

	public void setEarnest(Double earnest) {
		this.earnest = earnest;
	}

	public Double getTotal() {
		return total;
	}

	public void setTotal(Double total) {
		this.total = total;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getConfirmDate() {
		return confirmDate;
	}

	public void setConfirmDate(Date confirmDate) {
		this.confirmDate = confirmDate;
	}

	public Date getGenerateDate() {
		return generateDate;
	}

	public void setGenerateDate(Date generateDate) {
		this.generateDate = generateDate;
	}

	public List<BankStatementItem> getBankStatementItems() {
		return bankStatementItems;
	}

	public void setBankStatementItems(List<BankStatementItem> bankStatementItems) {
		this.bankStatementItems = bankStatementItems;
	}

	public List<BankStatementCharge> getBankStatementCharges() {
		return bankStatementCharges;
	}

	public void setBankStatementCharges(List<BankStatementCharge> bankStatementCharges) {
		this.bankStatementCharges = bankStatementCharges;
	}

	public String getNo() {
		return ProjectUtils.getBankStatementNo(getObjectId());
	}

	public Integer getMakerUserId() {
		return makerUserId;
	}

	public void setMakerUserId(Integer makerUserId) {
		this.makerUserId = makerUserId;
	}

	public Integer getConfirmuUserId() {
		return confirmuUserId;
	}

	public void setConfirmuUserId(Integer confirmuUserId) {
		this.confirmuUserId = confirmuUserId;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Date getSendDate() {
		return sendDate;
	}

	public void setSendDate(Date sendDate) {
		this.sendDate = sendDate;
	}

	public Integer getFinanceStatus() {
		return financeStatus;
	}

	public void setFinanceStatus(Integer financeStatus) {
		this.financeStatus = financeStatus;
	}

	public Integer getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(Integer supplierId) {
		this.supplierId = supplierId;
	}

	public Supplier getSupplier() {
		return supplier;
	}

	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}

	public Date getPredictPayDate() {
		return predictPayDate;
	}

	public void setPredictPayDate(Date predictPayDate) {
		this.predictPayDate = predictPayDate;
	}

	public Integer getApprovalUserId() {
		return approvalUserId;
	}

	public void setApprovalUserId(Integer approvalUserId) {
		this.approvalUserId = approvalUserId;
	}

	public Date getApprovalDate() {
		return approvalDate;
	}

	public void setApprovalDate(Date approvalDate) {
		this.approvalDate = approvalDate;
	}
}
